# -*- coding: utf-8 -*-

__author__	= 'Souheil CHELFOUH <souheil@chelfouh.com>'
__docformat__	= 'plaintext'

from Products.Archetypes.public import Schema
from Products.Archetypes.public import TextField
from Products.Archetypes.public import RichWidget, TextAreaWidget
from Products.Archetypes.public import RFC822Marshaller
from Products.Archetypes.public import AnnotationStorage

from Products.ATContentTypes.configuration import zconf


bodySchema = Schema((
    TextField('text',
              required=True,
              searchable=True,
              primary=True,
              storage = AnnotationStorage(migrate=True),
              validators = ('isTidyHtmlWithCleanup',),
              default_content_type = zconf.ATDocument.default_content_type,
              default_output_type = 'text/x-html-safe',
              allowable_content_types = zconf.ATDocument.allowed_content_types,
              widget = TextAreaWidget(description = "The body of the post",
                                      description_msgid = "help_body_text",
                                      label = "Body Text",
                                      label_msgid = "label_body_text",
                                      rows = 15,
                                      i18n_domain = "plone",
                                      allow_file_upload = zconf.ATDocument.allow_document_upload)
              ),
    ), marshall=RFC822Marshaller())
